<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security">

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用户列表</title>
    <script type="text/javascript" src="/public.js"></script>
    <script type="text/javascript" src="/js/user/init.js"></script>
    <script type="text/javascript" src="/js/user/authRole.js"></script>
</head>
<body>
<div>
    <div id="tb" style="padding:3px">
        <span style="font-size:9px;">账户名称:</span>
        <input id="userName" style="line-height:20px;border:1px solid #ccc">
        <a href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="doSearch()">查询</a>
    </div>
    <table id="dg" title="" class="easyui-datagrid" toolbar="#toolbarId" pagination="true"
           rownumbers="true" fitColumns="true" striped="true" fit="false">
    </table>

    <!-- 工具条 -->
    <div id="toolbarId" style="padding: 5px; height: auto">
        <!-- todo: id="buttonId" is must-->
        <div style="margin-bottom: 5px" id="buttonId">
            <a href="javascript:void(0)" id="addUserId" isButton="hasRole('admin')"
               class="easyui-linkbutton" onclick="addDialog()"
               iconCls="icon-add" plain="true">添加</a>
            <a href="javascript:void(0)" id="updateId" isButton="hasRole('admin')"
               class="easyui-linkbutton" onclick="updateDialog()"
               iconCls="icon-edit" plain="true">修改</a>
            <a href="javascript:void(0)" id="delId"
               class="easyui-linkbutton" onclick="del()" isButton="hasPerm('sys:user:delete')"
               iconCls="icon-remove" plain="true">删除</a>
            <a href="javascript:void(0)" id="roleId"
               class="easyui-linkbutton" onclick="authRole()" isButton="hasRole('admin')"
               iconCls="icon-role2" plain="true">授权角色</a>
        </div>
    </div>

    <!--对话框-->
    <div id="dialogId" class="easyui-dialog" title=""
         style="width: 500px; height: 200px;" data-options="modal:true"
         closed="true" buttons="#dialogIdToolbarId">
        <!--<form id="fromId" method="post" style="margin-top: 30px" enctype="multipart/form-data">-->
        <form id="fromId" method="post" style="margin-top: 30px">
            <table width="100%" height=""
                   style="BORDER-COLLAPSE: collapse;" cellpadding="1" border="1"
                   borderColor="#BEBEBE" align="center">
                <tr>
                    <td style="background: #E0EEEE"><label>登录账户名：</label></td>
                    <td>
                        <input id="pkId" type="hidden" name="id" />
                        <input type="text" class="easyui-validatebox"
                               name="username" missingMessage="请输入填写登录账户名" readonly="readonly"
                               data-options="required:true,validType:['username','minLength[1]','maxLength[8]']" />
                    </td>
                </tr>
                <tr>
                    <td style="background: #E0EEEE"><label>密码：</label></td>
                    <td><input type="password" class="easyui-validatebox" id="password"
                               name="password" missingMessage="请输入密码"
                               data-options="required:true,validType:['unChinese','unNormal','minLength[1]','maxLength[8]']" />
                    </td>
                </tr>
                <tr>
                    <td style="background: #E0EEEE"><label>确认密码：</label></td>
                    <td><input type="password" class="easyui-validatebox"
                               missingMessage="请确认密码"
                               data-options="required:true,validType:['same[\'password\']','unChinese','unNormal','minLength[1]','maxLength[8]']" />
                    </td>
                </tr>
            </table>
        </form>
    </div>

    <div id="dialogIdToolbarId">
        <div style="margin-bottom: 5px">
            <a href="javascript:void(0)" id="saveId" class="easyui-linkbutton" iconCls="icon-ok" plain="true">保存</a>
            <a href="javascript:void(0)" id="closeId" class="easyui-linkbutton" iconCls="icon-cancel" plain="true">取消</a>
        </div>
    </div>

    <!-- 角色对话框，授权角色-引入authRole.js -->
    <div id="dialogId2" class="easyui-dialog" title=""
         style="width: 500px; height: 450px;" data-options="modal:true"
         closed="true" buttons="#dialogIdToolbarId2">
        <!--<form id="fromId" method="post" style="margin-top: 30px" enctype="multipart/form-data">-->
        <form id="fromId2" method="post" style="margin-top: 30px">
            <input id="userId" type="hidden" readonly="readonly" value="" />
            <ul id="roleTreeId" class="" style="margin: 10px 0px 0px 20px;"></ul>
        </form>
    </div>

    <div id="dialogIdToolbarId2">
        <div style="margin-bottom: 5px">
            <a href="javascript:void(0)" id="saveId2" class="easyui-linkbutton" iconCls="icon-ok" plain="true">保存</a>
            <a href="javascript:void(0)" id="closeId2" class="easyui-linkbutton" iconCls="icon-cancel" plain="true">取消</a>
        </div>
    </div>

</div>
</body>
</html>